<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/19
 * Time: 16:17
 */
namespace app\Admin\validate;
use think\Validate;
class  User extends Validate{
    protected $rule =   [
        'name'  => 'require|max:5',
        'age'   => 'number|between:1,120',
        'email' => 'email',
    ];
    protected $message  =   [
        'name.require' => '名称必须填写',
        'name.max'     => '名称最多不能超过5个字符',
        'age.number'   => '年龄必须是数字',
        'age.between'  => '年龄只能在1-120之间',
        'email'        => '邮箱格式错误',
    ];
}